package com.asj.house.controller;

import com.asj.house.client.HouseIntermediaryClient;
import com.asj.house.returns.RespEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("house-intermediary")
@Api(value = "房源中介接口", tags = "房源中介接口")
@Slf4j
public class HouseIntermediaryController {

    @Resource
    private HouseIntermediaryClient houseIntermediaryClient;

    @GetMapping("/list")
    @ApiOperation(value = "房源中介信息")
    @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "roomId", value = "房源id", required = true)
    public RespEntity listIntermediary(@RequestParam(value = "roomId", required = true) Integer roomId) {
        RespEntity respEntity = houseIntermediaryClient.listIntermediary(roomId);
        return respEntity;
    }

}
